Package eu.europa.ec.taxud.cesop.readers
Class PspXmlReader
- java.lang.Object
-
- eu.europa.ec.taxud.cesop.readers.PspXmlReader
-
- All Implemented Interfaces:
IPspXmlReader,AutoCloseable,Iterator<XmlPaymentDataMsgPart>
public class PspXmlReader extends Object implements IPspXmlReader
Utils class reading a PSP XML file.
-
-
Constructor Summary
Constructors Constructor Description PspXmlReader(InputStream inputStream, long estimatedSize, int maxTransactionsInPart, boolean validateXsd)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()longgetEstimatedContentSize()Gets estimated content size.XmlMessageSpecgetXmlMessageSpec()Returns parsed MessageSpec part.XmlPspgetXmlReportingPsp()Returns parsed MessageSpec part.booleanhasNext()XmlPaymentDataMsgPartnext()Parse the next part of payment data.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Constructor Detail
-
PspXmlReader
public PspXmlReader(InputStream inputStream, long estimatedSize, int maxTransactionsInPart, boolean validateXsd) throws XMLStreamException
Constructor.- Parameters:
inputStream- the input stream. The input stream is not closed byPspXmlReader.estimatedSize- estimated content length in bytes, negative means that estimation is not availablemaxTransactionsInPart- the max number of transactions to be included in a payment data msg partvalidateXsd- true if validation againstXsdSchemaneeded- Throws:
XMLStreamException- in case of error while processing the XML content
-
-
Method Detail
-
getEstimatedContentSize
public long getEstimatedContentSize()
Description copied from interface:IPspXmlReaderGets estimated content size.- Specified by:
getEstimatedContentSizein interfaceIPspXmlReader- Returns:
- returns content size in bytes if available. If not, returns -1.
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfaceIterator<XmlPaymentDataMsgPart>
-
next
public XmlPaymentDataMsgPart next()
Description copied from interface:IPspXmlReaderParse the next part of payment data. For every payee it first yields one or more parts withPaymentDataMsgPartContentType.REPORTED_TRANSACTIONStype. Then, after all payee transactions are produced, onePaymentDataMsgPartContentType.REPORTED_PAYEEpart is yielded.- Specified by:
nextin interfaceIPspXmlReader- Specified by:
nextin interfaceIterator<XmlPaymentDataMsgPart>
-
getXmlMessageSpec
public XmlMessageSpec getXmlMessageSpec()
Description copied from interface:IPspXmlReaderReturns parsed MessageSpec part. Available at any point of iteration.- Specified by:
getXmlMessageSpecin interfaceIPspXmlReader- Returns:
- the xml message spec
-
getXmlReportingPsp
public XmlPsp getXmlReportingPsp()
Description copied from interface:IPspXmlReaderReturns parsed MessageSpec part. Available at any point of iteration.- Specified by:
getXmlReportingPspin interfaceIPspXmlReader- Returns:
- the xml reporting psp
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
-